//房源panal
Ext.define('customer.payDeposit.add.estatePanel',{
	extend : 'Ext.form.Panel',
	initComponent:function(){
		var me=this;
		var row_1={
				xtype: "container",
	            layout: "hbox",
	            items:{
	            	xtype: 'radiogroup',
	                fieldLabel: '无房认筹',
	                name:"isPaydeposit",
	                items: [
	                    {boxLabel: '否', name: 'checkStatus', checked: true,inputValue:'0'},
	                    {boxLabel: '是', name: 'checkStatus',inputValue:'1'}
	                ],
	                listeners: {
	                	change: {
	                        fn: function(){
	                        	var isPaydeposit=me.getForm().findField("isPaydeposit").getChecked()[0].inputValue;
	                        	if(isPaydeposit=="1"){
	                        		me.getComponent("isPaydepositTrue").hide();
	                        	}else{
	                        		me.getComponent("isPaydepositTrue").show();
	                        	}
	                        }
	                    }
	                }
	            }
				
	    };
		var row_2={
				id:"isPaydepositTrue",
				fieldDefaults: {
			            labelAlign: 'top',
			            msgTarget: 'side'
			    },
			    defaults: {
			            border: false,
			            xtype: 'panel',
			            flex: 1,
			            layout: 'anchor'
			    },
			    border: false,
				layout: 'hbox',
				items: [{
		            items: [{
		            	xtype:'container',
		            	layout:'hbox',
		            	border:true,
		            	items:[
							{
							    xtype:'textfield',
							    fieldLabel: '认筹编号',
							    name: 'payDepositId',
							    id: 'payDepositId',
							    hidden: true,
							    readOnly:true,
							    value: payDepositId
							},
		            		{xtype: "textfield", id: "projectId", name: "projectId", hidden: true},
	            			{
		            		xtype:'textfield',
			                fieldLabel: '房号',
			                name: 'combinedName',
			                readOnly:true
			                },{
			                	xtype:'button',
			                	text:'选择房源',
			                	margin: 5,
			                	iconCls:'icon-search', 
			           		    handler: function() {
			           		 	    var selectWindow=Ext.create('component.estate.selectWindow',{
			           		 	        callbackFun: function (record) {
			           		 	          var result=Ext.JSON.decode(record);
				           		 	      var form=me.getForm();
			           		 	          form.setValues(result);
			           		 	        },
			           		 	        rStatus: '1',
			           		 	        customerId:customerId
			           		 	    });
			           		 	    selectWindow.show();
			        		    }
			                }]
		                
		            }, {
		                xtype:'textfield',
		                fieldLabel: '建筑面积(㎡)',
		                anchor: '80%',
		                name: 'buildingArea',
		                readOnly:true
		            }, {
		                xtype:'textfield',
		                fieldLabel: '分摊面积(㎡)',
		                anchor: '80%',
		                name: 'sharingArea',
		                readOnly:true
		            }, {
		                xtype:'textfield',
		                fieldLabel: '折前单价(元)',
		                anchor: '80%',
		                name: 'unitPrice',
		                readOnly:true
		            },{
		                xtype:'textfield',
		                fieldLabel: '房源ID',
		                name: 'id',
		                readOnly:true,
		                hidden:true
		            },{
		            	xtype: 'hiddenfield',
		            	name:'floatingRange'
		            },{
		            	xtype: 'hiddenfield',
		            	name:'discountRate'
		            },{
		            	xtype: 'hiddenfield',
		            	name:'floorType'
		            }]
		        }, {
		            items: [{
		                xtype:'textfield',
		                fieldLabel: '房源状态',
		                anchor: '80%',
		                name: 'roomStatusName',
		                readOnly:true
		            },{
		                xtype:'textfield',
		                fieldLabel: '套内面积(㎡)',
		                anchor: '80%',
		                name: 'innerArea',
		                readOnly:true
		            },{
		                xtype:'textfield',
		                fieldLabel: '计价面积(㎡)',
		                anchor: '80%',
		                name: 'billingArea',
		                readOnly:true
		            },{
		                xtype:'textfield',
		                fieldLabel: '折前总价(元)',
		                anchor: '80%',
		                name: 'totalPrice',
		                readOnly:true
		            }]
		        }]
	    };
		var items=[row_1,row_2];
		var initConfigg = {
				title:"房产信息",
				id:'estatePanel',
				bodyStyle: 'padding:5px 5px 0',
		        minHeight: 200,
		        fieldDefaults: {
		            labelAlign: 'left',
		            msgTarget: 'side',
		            margin: 5
		        },
		        items:items
		};
		Ext.apply(this,initConfigg);
		this.callParent(arguments);
	}
});

Ext.define('customer.payDeposit.add.customerPanel',{
	extend : 'Ext.form.Panel',
	initComponent:function(){
		var me=this;
		
		var documentTypeStore = Ext.create('Ext.data.Store', {
		    fields: ['value', 'name'],
		    data :documentType
		});
		var row_1={
				fieldDefaults: {
			            labelAlign: 'top',
			            msgTarget: 'side'
			    },
			    border: false,
			    defaults: {
			            border: false,
			            xtype: 'panel',
			            flex: 1,
			            layout: 'anchor'
			    },
				layout: 'hbox',
				items: [{
		            items: [{
		            	xtype:'container',
		            	layout:'hbox',
		            	anchor: '80%',
		            	items:[{
		            		xtype:'textfield',
			                fieldLabel: '客户姓名',
			                anchor: '80%',
			                name: 'customerName',
			                readOnly:true,
			                allowBlank:false
			                },{
			                	xtype:'button',
			                	text:'选择客户',
			                	margin: 5,
			                	hidden:showChooseCustomer,
			                	iconCls:'icon-search', 
			           		    handler: function() {
			           		    	var projectId ="";
			           		    	if(customerProjectId!="" && null!=customerProjectId){
			           		    		projectId=customerProjectId;
			           		    	}else{
			           		    		projectId = Ext.getCmp("projectId").getValue();
			           		    	}
			           		    	//alert(projectId);
			           		 	    var selectWindow=Ext.create('component.customer.selectWindow',{
			           		 			callbackFun: function (record) {
		           		 	          		var result=Ext.JSON.decode(record);
			           		 	          	Ext.getCmp('userName').setValue("");
			           		 	          	Ext.getCmp('userName').setValue(result.userId);
			           		 	          	userIdStore.load({
			           		 	        		params:{
			           		 	        			'projectId':result.projectId
			           		 	        	  	}
			           		 	          	});
				           		 	       	var form=me.getForm();
				           		 	     	form.setValues(result);
				           		 	       	var extraParams=gridStore.getProxy().extraParams;
				           		 	     	extraParams.customerId=Ext.getCmp('customerId').getValue();
				           		 	      	gridStore.load();
				           		 	        customerId=extraParams.customerId;
				           		 	    if(gridStore.getCount()>=4){
				    				    	Ext.getCmp("insertBtn").setVisible(false);
				    				    }
			           		 	        },
			           		 	        projectId: projectId,
			           		 	        resourcesCode:'menu_0006_0001'
			           		 	    });
			           		 	    selectWindow.show();
			        		    }
			                }]
		                
		            }, {
		                xtype:'combobox',
		                fieldLabel: '<font style=\"color: #e90000;\">*</font>证件类型',
		                anchor: '80%',
		                name: 'peDocumentTypeName',
		                store: documentTypeStore,
					    queryMode: 'local',
					    typeAhead: true,
					    displayField: 'name',
					    valueField: 'value',
		                allowBlank:false,
		                blankText:'客户信息证件类型不能为空'
		            }, {
		                xtype:'textfield',
		                fieldLabel: '<font style=\"color: #e90000;\">*</font>证件号码',
		                anchor: '80%',
		                name: 'peDocumentNumber',
		                allowBlank:false,
		                blankText:'客户信息证件号码不能为空',
		                maxLength:18
		            }, {
		                xtype:'numberfield',
		                fieldLabel: '<font style=\"color: #e90000;\">*</font>联系电话',
		                anchor: '80%',
		                name: 'customerPhone',
		                hideTrigger:true,
		                readOnly:true,
		                maxLength:11
		            }]
		        }, {
		            items: [{
		                xtype:'textfield',
		                fieldLabel: '<font style="color: #e90000;">*</font>邮寄地址',
		                anchor: '80%',
		                name: 'peContactAddress',
		                allowBlank:false,
		                blankText:'不能为空'
		            },{
		                xtype:'numberfield',
		                fieldLabel: '<font style="color: #e90000;">*</font>邮编',
		                anchor: '80%',
		                name: 'pePostcode',
		                allowBlank:false,
		                hideTrigger:true,
		                blankText:'不能为空',
		                maxLength:6
		            },{
		                xtype:'textfield',
		                fieldLabel: '客户来源',
		                anchor: '80%',
		                name: 'customerOriginName',
		                readOnly:true
		            },{
		                xtype:'textfield',
		                fieldLabel: 'ID',
		                anchor: '80%',
		                name: 'id',
		                id:'customerId',
		                readOnly:true,
		                hidden:true
		            }]
		        }]
	    };
		
		var gridStore = Ext.create('Ext.data.Store', {
			id:'familyMemberGridStore',
		    fields: ["memberName","documentType","mobile","documentNumber"],
		    //是否在服务端排序 （true的话，在客户端就不能排序）
		    remoteSort: false,
		    proxy: {
		        type: 'ajax',
		        url: contextPath+'/customer/familyMember/findList',
		        reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
		            type: 'json', //返回数据类型为json格式
		            root: 'obj'
		        },
		        actionMethods: {read: 'POST'},
		        extraParams:{
	            	buyId: payDepositId,
	            	memberType: '2'
	            }
		    }
		});
		var columns = [{
			text : "姓名",
			dataIndex : 'memberName',
			width:'20%',
			editor: {
                xtype: 'textfield'
            }
		}, {
			text : "<font style=\"color: #e90000;\">*</font>证件类型",
			dataIndex : 'documentType',
			width:'20%',
			editor: new Ext.form.field.ComboBox({
			    store: documentTypeStore,
			    queryMode: 'local',
			    displayField: 'name',
			    valueField: 'value'
            }),
            renderer: function(value,metadata,record){  
                var index = documentTypeStore.find('value',value);  
                if(index!=-1){  
                    return documentTypeStore.getAt(index).data.name;  
                }  
                return value;  
            }
		}, {
			text : "<font style=\"color: #e90000;\">*</font>证件号码",
			dataIndex : 'documentNumber',
			width:'20%',
			editor: {
                xtype: 'textfield',
                maxLength:18
            }
            
		},{
			text : "手机号码",
			dataIndex : 'mobile',
			width:'20%',
			editor: {
                xtype: 'textfield'
            }
		},{
        	text:'操作',
        	xtype : 'actioncolumn',
        	items:[{
        		 iconCls:'icon-delete',
        		 tooltip: '删除', 
        		 handler: function(grid, rowIndex, colIndex) {
        			 gridStore.removeAt(rowIndex);
        			  if(gridStore.getCount()<4){
   				    	Ext.getCmp("insertBtn").setVisible(true);
   				    	Ext.getCmp("customerSelectBtn").setVisible(true);
   				    }
        		 }
        	}]
        }];
		var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
	        clicksToEdit: 1
	    });
		var row_2=Ext.create('Ext.grid.Panel', {
			id:'familyMemberGridPanel',
			region : 'south',
			title:"共同购房者",
			minHeight:200,
			columnLines: true,
	        viewConfig: {
	            stripeRows: true
	        },
			store : gridStore,
			columns : columns,
			plugins: [cellEditing],
			tbar:[{text:'新增',iconCls:'icon-add',id:'insertBtn',
				handler:function(){
					
				    Ext.define('Record', { 
			            extend: 'Ext.data.Model' 
				    }); 
				    var record  = new Record(); 
				    gridStore.insert(0, record);
				    cellEditing.startEditByPosition({
				        row: 0, 
				    	column: 0
				    });
				    if(gridStore.getCount()>=4){
				    	Ext.getCmp("insertBtn").setVisible(false);
				    	Ext.getCmp("customerSelectBtn").setVisible(false);
				    }
				    
			}
			},{
            	xtype:'button',
            	text:'选择客户',
            	margin: 5,
            	iconCls:'icon-search',
            	id:'customerSelectBtn',
       		    handler: function() {
       		    	var projectId = Ext.getCmp("projectId").getValue();
       		    	
       		 	    var selectWindow=Ext.create('component.customer.selectWindow',{
       		 			callbackFun: function (record) {
   		 	          		var result=Ext.JSON.decode(record);
   		 	          		/*result.peDocumentType;
   		 	          	    result.peDocumentNumber;
   		 	          		result.customerName;
   		 	          		result.customerPhone;*/
   		 	          		
		           		 	Ext.define('Record', { 
					            extend: 'Ext.data.Model',
					            fields: ["memberName","documentType","mobile","documentNumber"]
						    }); 
						    var record  = new Record({
						    	 memberName:result.customerName,
						    	 documentType:result.peDocumentType,
						    	 mobile:result.customerPhone,
						    	 documentNumber:result.peDocumentNumber
						    }); 
						    gridStore.insert(0, record);
						    
						    if(gridStore.getCount()>=4){
						    	Ext.getCmp("insertBtn").setVisible(false);
						    	Ext.getCmp("customerSelectBtn").setVisible(false);
						    	return;
						    }
						    
       		 	        },
       		 	        projectId: projectId,
       		 	        resourcesCode:'menu_0006_0001'
       		 	    });
       		 	    selectWindow.show();
    		    }
			}
			]
		});
		var items=[row_1,row_2];
		var initConfigg = {
				id:"customerPanel",
		        title:"客户信息",
		        minHeight:320,
		        fieldDefaults: {
		            labelAlign: 'left',
		            msgTarget: 'side',
		            margin: 5
		        },
		        items:items
		};
		Ext.apply(this,initConfigg);
		this.callParent(arguments);
	}
});
Ext.define('customer.payDeposit.add.payDepositPanel',{
	extend : 'Ext.form.Panel',
	initComponent:function(){
		var row_1={
				fieldDefaults: {
			            labelAlign: 'left',
			            msgTarget: 'side'
			    },
			    border: false,
			    defaults: {
			            border: false,
			            xtype: 'panel',
			            flex: 1,
			            layout: 'anchor'
			    },
				layout: 'hbox',
				items: [{
		            items: [{
		                xtype:'textfield',
		                fieldLabel: '认筹编号',
		                anchor: '80%',
		                name: 'depositCode',
		                value: depositCode
		            }
//		            , {
//		                xtype:'numberfield',
//		                fieldLabel: '抵房款金',
//		                anchor: '80%',
//		                name: 'deductibleAmount',
//		                value: 0,
//		                decimalPrecision : 2,    // 精确的位数
//                        allowNegative : false,    //是否允许负数
//                        maxValue:1000000000
//		            }
//		            , {
//		            	xtype:'container',
//		            	layout:'hbox',
//		            	items:[{
//		            		xtype:'datefield',
//			                fieldLabel:'<font style=\"color: #e90000;\">*</font>有效日期',
//			                name:'startTime',
//			                format: 'Y-m-d',
//			                allowBlank:false,
//			                blankText:'不能为空'
//			                
//		            	},{
//		            		xtype:'datefield',
//		            		hideLabel:true,
//		            		name:'endTime',
//			                format: 'Y-m-d',
//			                allowBlank:false,
//			                blankText:'不能为空'
//		            	}]
//		                
//		            }
		            , {


			            xtype:'combobox',  
			            id:'userName',  
			            store: userIdStore,
			            displayField: "userName",           
			            valueField: "id",  
			            fieldLabel:'<font style=\"color: #e90000;\">*</font>经纪人',  
			            width:200,
		    			name:'agentId',
		    			queryMode : 'local',
						allowBlank:false,
		                blankText:'不能为空'

		            },{
		            	xtype: 'textarea',
		                fieldLabel: '备注',
		                anchor: '80%',
		                name:'remark',
		                value: remark
		            }]
		        }, {
		            items: [{
		                xtype:'numberfield',
		                fieldLabel: '<font style=\"color: #e90000;\">*</font>认筹金(元)',
		                anchor: '80%',
		                name: 'payDepositAmount',
		                allowBlank:false,
		                validateBlank:true,
		                allowBlank:false,
		                blankText:'不能为空',
		                hideTrigger:true,
		                decimalPrecision : 2,    // 精确的位数
                        allowNegative : false,    //是否允许负数
                        maxValue:1000000000,
                        value: payDepositAmount
		            },{
		                xtype:'datefield',
		                fieldLabel: '<font style=\"color: #e90000;\">*</font>认筹日期',
		                anchor: '80%',
		                name:'didTime',
		                allowBlank:false,
		                format: 'Y-m-d',
		                allowBlank:false,
		                blankText:'不能为空',
		                value: Ext.Date.format(new Date(didTime),'Y-m-d')
		            }]
		        }]
	    };
		var items=[row_1];
		var initConfigg = {
		        title:"认筹信息",
		        minHeight:200,
		        fieldDefaults: {
		            labelAlign: 'left',
		            msgTarget: 'side',
		            margin: 5
		        },
		        items:items
		};
		Ext.apply(this,initConfigg);
		this.callParent(arguments);
	}
});

Ext.define('customer.payDeposit.addPanel',{
	extend : 'Ext.form.Panel',
	initComponent:function(){
		var estatePanel= Ext.create("customer.payDeposit.add.estatePanel");
		var customerPanel= Ext.create("customer.payDeposit.add.customerPanel");
		var payDepositPanel= Ext.create("customer.payDeposit.add.payDepositPanel");
		
		var fileAttachment = Ext.create('component.file.attachment',{
		    objectId: payDepositId,
		    imageType: "7",
		    contextPath:contextPath,
		    //显示上传按钮
		    showBtn: "T",
		    //显示上传图片删除按钮
		    showDelBtn: "T"
		});
		
		var submitFun=function(processKey){
			//房源信息
       	 var estateForm=estatePanel.getForm();
       	 var payDepositId = estateForm.findField("payDepositId").getValue();
       	 var isPaydeposit=estateForm.findField("isPaydeposit").getChecked()[0].inputValue;
       	 var roomId=estateForm.findField("id").getValue();
       	 var billingArea=estateForm.findField("billingArea").getValue();
       	 var totalPrice=estateForm.findField("totalPrice").getValue();
       	 var unitPrice=estateForm.findField("unitPrice").getValue();
       	 var discountRate=estateForm.findField("discountRate").getValue();
       	 var floatingRange=estateForm.findField("floatingRange").getValue();
       	 var floorType=estateForm.findField("floorType").getValue();
       	 if(isPaydeposit=="0" && (roomId=="" || null==roomId)){
       		 Ext.Msg.alert('提示', '请选择房源');
           	 return;
       	 }
       	 //客户信息
       	 var customerForm=customerPanel.getForm();
       	 var customerId=customerForm.findField("id").getValue();
       	 if(customerId=="" || null==customerId){
       		 Ext.Msg.alert('提示', '请选择客源');
           	 return;
       	 }
       	 var customerForm = customerPanel.getForm();
       	 if(!customerForm.isValid()){
       		 return;
       	 }
       	 //认筹金不能大于折前总价
      
       	 
       	 //认筹信息
       	var form = payDepositPanel.getForm();
       	var validPayDepositAmount =  form.findField("payDepositAmount").getValue();
       	if(validPayDepositAmount!=null&&validPayDepositAmount!=""){
       		validPayDepositAmount = parseFloat(validPayDepositAmount);
       		totalPrice = parseFloat(totalPrice);
       		if(validPayDepositAmount>totalPrice){
       		 Ext.Msg.alert('提示', '认筹金不能大于折前总价！');
           	 return;
       		}
       	}
      	if(form.isValid()){
      	  	 var familyMemberGridStore=customerPanel.getComponent("familyMemberGridPanel").getStore();
           	 var jsonArray=[];
        		 var recordsCount=familyMemberGridStore.getCount();
        		 if(recordsCount>0){
        			 for(var i=0;i<recordsCount;i++){
        				 var documentNumber = familyMemberGridStore.getAt(i).data.documentNumber;
        				 if(documentNumber==null||documentNumber==""){
        					 Ext.Msg.alert('提示', '请填写共同购房者证件号码!');
        		           	 return;
        				 }else{
        					 //验证手机号码的正确性
        					 var userPhone = familyMemberGridStore.getAt(i).data.mobile;
        					 if(userPhone!=null&&userPhone!=""){
//        						 var regTel = /^0?1[3|4|5|6|7|8|9][0-9]\d{8}$/;
//        						 if(!regTel.test(userPhone)){
//        							 Ext.Msg.alert('提示', '请输入正确的手机号码!');
//        							 return;
//        						 }
        						 Ext.Ajax.request({
	    							url: contextPath+'/common/mobile/verifyingMobile',
	    							params: {
	    								mobile: userPhone,
	    							},
	    							method: 'POST',
	    							async: false,
	    							success: function(response){
	    								var text = Ext.decode(response.responseText);
	    								if(text.result=="1"){
	    									if(text.flag != "1"){
	    										Ext.Msg.alert('提示', '请输入正确的手机号码!');
	    		    							return;
	    									}
	    								}
	    							}
	    						 });
        					 }
        					 
        					 jsonArray.push(Ext.JSON.encode(familyMemberGridStore.getAt(i).data));
        				 }
        	    	 }
        		 }
        	 //判断证件类型是否做了修改
             var peDocumentType = customerForm.findField("peDocumentTypeName").getValue();
             if(isNaN(peDocumentType)){
            	 peDocumentType = "";
             }
             
           	 //认筹信息
           	 var payDeposit=payDepositPanel.getForm().getValues();
           	 if(payDepositPanel.isValid()){
           	 	var params={};
           	 params.floorType=floorType;
           	 params.isPaydeposit=isPaydeposit;
           	 params.id=payDepositId;
           	 params.roomId=roomId;
           	 params.calculateArea=billingArea;
           	 params.discountTotalPrice=totalPrice;
           	 params.discountPrice=unitPrice;
           	 params.floatingRange=floatingRange;
           	 params.discountRate = discountRate;
           	 params.customerId=customerId;
           	 params.depositCode=payDeposit['depositCode'];
           	 params.deductibleAmount=payDeposit['deductibleAmount'];
           	 params.payDepositAmount=payDeposit['payDepositAmount'];
           	 params.didTime=payDeposit['didTime'];
//           	 params.startTime=payDeposit['startTime'];
//           	 params.endTime=payDeposit['endTime'];
           	 params.remark=payDeposit['remark'];
           	 params.agentId=payDeposit['agentId'];
           	 params.familyMember=jsonArray;
           	 //客户信息
           	 params.peDocumentTypeName = peDocumentType;
           	 params.peDocumentNumber = customerForm.findField("peDocumentNumber").getValue();
           	 params.peContactAddress = customerForm.findField("peContactAddress").getValue();
           	 params.pePostcode = customerForm.findField("pePostcode").getValue();
          	 params.customerName = customerForm.findField("customerName").getValue();
          	 console.log(params);
           	 //流程图片
             var fileArr = Ext.getCmp("fileUrlArr").getValue();
             params.imageType = "7";
             params.fileArr = fileAttachment.getFileArrs();
           	 var resultJson=Ext.JSON.encode(params);
           	 if(processKey){
           		 Ext.getCmp("save_button").setVisible(false);
           	 }
           	 Ext.Ajax.request({
        	    url: contextPath+'/customer/payDeposit/add',
        	    params: {
        	    	params: resultJson,
        	    	processKey:processKey,
        	    	roomId:roomId
        	    },
        	    method: 'POST',
        	    success: function(response){
        	        var text = Ext.decode(response.responseText);
        	        if(text.res=="1"){
        	        	Ext.getCmp("payDepositId").setValue(text.obj);
        	        	//fileAttachment.deleteBtnHidden();
        	        	Ext.Msg.alert('提示', text.resMsg);
        	        	//成功，跳转到查看页面
        	        	var url = contextPath+"/customer/payDeposit/toView?id="+text.obj+"&returnUrl=,marketing,pin,index"
        	        	window.location.href=url;
        	        }else if(text.res=="100"){
        	        	Ext.Msg.alert('提示', '权限不足！');
        	        	 Ext.getCmp("save_button").setVisible(true);
        	        }else{
        	        	Ext.getCmp("save_button").setVisible(true);
        	        	Ext.Msg.alert('提示', '认筹失败！原因：'+text.resMsg);
        	        }
        	    }
        	});
      	}
	}
};
		var defaultConfigg = {
				buttonAlign:'center',
				defaults: {  
		            split: true,    //有分割线  
		            collapsible: true  //可以折叠
		        },
		        renderTo:Ext.getBody(),
				items:[estatePanel,customerPanel,payDepositPanel,fileAttachment],
				buttons:[
						{xtype: "button",id:'save_hold_button',text: "保存",handler: function(){
							 submitFun("");
						}},
				         {/*hidden:payDepositAddOK,*/xtype: "button",id:'save_button',text: "提交审核",handler: function(){
				        	 submitFun("cusPayDeposit");
				         }},{xtype: "button",text: "返回",handler: function(){
//				        		location.href=contextPath+"/marketing/room/index?menu="+menu;
				        	 location.href=contextPath+returnUrl;
//				        	 	history.go(-1);
				         }}
				]
		};
		Ext.apply(this,defaultConfigg);
		this.callParent(arguments);
	}
});


